package com.sba.core.repository;

import java.util.List;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import com.sba.core.domain.User;

/**
 * 
 * @author feiliming
 *
 */
public interface UserRepository extends BaseRepository<User> {

	//判断登录名是否已存在
	List<User> findByLoginNameAndIsDelete(String loginName, int isDelete);
	//判断登录名是否禁用
	List<User> findByLoginNameAndIsDisabledAndIsDelete(String loginName, int isDisabled, int isDelete);
	//验证用户名和密码
	List<User> findByLoginNameAndPasswordAndIsDelete(String loginName, String password, int isDelete);
	
	//全部用户
	Page<User> findByIsDelete(int isDelete, Pageable pageable);
	//某机构下全部用户
	Page<User> findByOrganizationIdAndIsDelete(Long organizationId, int isDelete, Pageable pageable);
	
}
